package com.hkbigdata.springbootdi.controller;

import com.hkbigdata.springbootdi.service.DIService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuanbo
 * @creat 2024-12-09-14:29
 * @see 2194550857@qq.com
 */
@RestController
public class DiController {
    @Autowired
    DIService diService;

    //1.
    @RequestMapping("/queryOrderStatus")
    public Object queryOrderStatus(String dt) {
        if (StringUtils.isNoneBlank(dt)) {
            return diService.getOrderStatus(dt);
        } else {
            return "参数不能为空";
        }
    }

    //2.
    @RequestMapping("/querybrandScore")
    public Object querybrandScore() {

        return diService.getRedisHotMobile();

    }

    //3.
    @RequestMapping("/querybrandSale")
    public Object querybrandSale() {

        return diService.getCkSaleAmount();

    }

    //4.
    @RequestMapping("/querybrandSaleAmountTotal")
    public Object querybrandSaleAmountTotal() {
        return diService.getCkSaleNum();
    }

    //5.
    @RequestMapping("/queryesTotal")
    public Object queryesTotal() {
        return diService.getEsSource();
    }

    //6.
    @RequestMapping("/getEsIndustry")
    public Object getEsIndustry() {
        return diService.getEsIndustry();
    }

    //7.
    @RequestMapping("/getCkProvinceSale")
    public Object getCkProvinceSale(String province) {
        return diService.getCkProvinceSale(province);
    }

    //8.
    @RequestMapping("/getCkProvinceSaleAndOrder")
    public Object getCkProvinceSaleAndOrder() {
        return diService.getCkProvinceSaleAndOrder();
    }

    //9. 日志数据写到kafka
    @RequestMapping("/app")
    public Object writeLogToKafka(String logStr) {
        diService.writeLogToKafka(logStr);
        return "success";
    }


}



